package com.android.tea;

import android.app.Activity;



public class MemberCenterActivity extends BaseWebViewActivity {
	
	@Override
	protected void setView() {
		layoutId = R.layout.main;
		super.setView();
	}

	@Override
	protected void initURL() {
		initUrl = "http://www.chabaike.cn/shop/mobile/user.php";
		super.initURL();
	}
	
	@Override
	protected void onStop() {
		super.stopLoading();
		super.onStop();
	}
	
	@Override
	public void onBackPressed() {
		int indexOf = currentUrl.indexOf("?");
		if(-1!=indexOf) {
			currentUrl = currentUrl.substring(0, indexOf);
		}
		
		indexOf = initUrl.indexOf("?");
		if(-1!=indexOf) {
			initUrl = initUrl.substring(0, indexOf);
		}
		if(!initUrl.equals(currentUrl)) {
			webView.goBack();
		}else {
			// 退出程序
			Activity parent = this.getParent();
			if(parent!=null) {
				parent.onBackPressed();
			}else{
				super.onBackPressed();
			}
		}
	}
}